useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.6.0_17'

	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() + 'protoStoreSales3a.bin')
		click('Edit1')
		select('JTreeTable', 'cell:Tree,1(null)')
		rightclick('JTreeTable', 'Tree,1')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,2(null)')
		rightclick('JTreeTable', 'Tree,2')
		select_menu('Expand Tree')
		select('LayoutCombo', 'Deptartment')
		select('JTreeTable', 'cell:Tree,12(null)')
		rightclick('JTreeTable', 'Tree,12')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,13(null)')
		rightclick('JTreeTable', 'Tree,13')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,5(null)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 410, Department: 410], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ], [, , 60, Department: 60], [, , 70, Department: 70], [, , 80, Department: 80], [, , 160, Department: 160], [, , 170, Department: 170], [, , 193, Department: 193], [, , 220, Department: 220], [, , 230, Department: 230], [, , 235, Department: 235], [, , 250, Department: 250], [, , 261, Department: 261], [, , 265, Department: 265], [, , 270, Department: 270], [, , 275, Department: 275], [, , 280, Department: 280], [, , 290, Department: 290], [, , 310, Department: 310], [, , 320, Department: 320], [, , 345, Department: 345], [, , 350, Department: 350], [, , 355, Department: 355], [, , 366, Department: 366], [, , 375, Department: 375], [, , 405, Department: 405], [, , 415, Department: 415], [, , 432, Department: 432], [, , 471, Department: 471], [, , 475, Department: 475], [, , 485, Department: 485], [, , 490, Department: 490], [, , 500, Department: 500], [, , 530, Department: 530], [, , 590, Department: 590], [, , 620, Department: 620], [, , 650, Department: 650], [, , 670, Department: 670], [, , 801, Department: 801], [, , 805, Department: 805], [, , 830, Department: 830], [, , 845, Department: 845], [, , 851, Department: 851], [, , 855, Department: 855], [, , 870, Department: 870], [, , 875, Department: 875], [, , 878, Department: 878], [, , 901, Department: 901], [, , 902, Department: 902], [, , 903, Department: 903], [, , 904, Department: 904], [, , 905, Department: 905], [, , 929, Department: 929], [, , 940, Department: 940], [, , 957, Department: 957], [, , 970, Department: 970], [, , 998, Department: 998], [, , , ], [, , , ]]')
		
#		select('JTreeTable', 'cell:Tree,15(null)')
#		click('MetalInternalFrameTitlePane', 653, 14)
##		zzzzzzzzzzz
#		select('JTreeTable', 'rows:[15],columns:[Tree]')
#		select('JTreeTable', 'rows:[15,16],columns:[Tree]')
		select('JTreeTable', 'rows:[15,16],columns:[department]')
##		zzzzzzzzzzz
		select_menu('Edit>>Copy Record#{s#}')
		select('JTreeTable', 'cell:Tree,3(null)')
		select_menu('Edit>>Paste Record#{s#}')
		select('JTreeTable', 'cell:Tree,15(null)')
		rightclick('JTreeTable', 'Tree,15')
		select_menu('Collapse Tree')
		select('JTreeTable', 'cell:Tree,3(null)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 70, Department: 70], [, , 80, Department: 80], [, , 410, Department: 410], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ], [, , , ]]')
		select('JTreeTable', 'cell:Tree,4(null)')
		rightclick('JTreeTable', 'Tree,4')
		select_menu('Fully Expand Tree')
		select('LayoutCombo', 'Product')
		select('JTreeTable', 'cell:Tree,17(null)')
		rightclick('JTreeTable', 'Tree,17')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,18(null)')
		rightclick('JTreeTable', 'Tree,18')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,4(null)')
		assert_p('JTreeTable', 'Content', '[[, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , 64614285, 40118, 1, 22990], [, , 67654448, 40118, 1, 23000], [, , 67654448, 40118, -1, -23000], [, , 67654448, 40118, 1, 19010], [, , 68614241, 40118, 1, 12990], [, , 68614787, 40118, 1, 27990], [, , 68634061, 40118, 1, 27990], [, , 69644337, 40118, 1, 29990], [, , 69654081, 40118, 1, 12990], [, , 69654135, 40118, 1, 12990], [, , , , , ], [, , , , , ], [, , , , , ], [, , 68664957, 40118, 1, 13990], [, , 69634699, 40118, 1, 20990], [, , 69634712, 40118, 1, 20990], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ]]')
##		zzzzzzzzzz
		click('Save1')

		select_menu('Window>>protoStoreSales3a.bin>>Tree View')
		click('Close')
		click('Open')

		click('Edit1')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,1')
		select_menu('Expand Tree')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,2')
		select_menu('Expand Tree')
		select('LayoutCombo', 'Deptartment')
		select('JTreeTable', 'cell:Tree,4(null)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 70, Department: 70], [, , 80, Department: 80], [, , 410, Department: 410], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ]]')
		select('JTreeTable', 'cell:Tree,4(null)')
		rightclick('JTreeTable', 'Tree,4')
		select_menu('Expand Tree')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,5')
		select_menu('Expand Tree')
		select('LayoutCombo', 'Product')
		select('JTreeTable', 'cell:saleDate,9(40118)')
		assert_p('JTreeTable', 'Content', '[[, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , 64614285, 40118, 1, 22990], [, , 67654448, 40118, 1, 23000], [, , 67654448, 40118, -1, -23000], [, , 67654448, 40118, 1, 19010], [, , 68614241, 40118, 1, 12990], [, , 68614787, 40118, 1, 27990], [, , 68634061, 40118, 1, 27990], [, , 69644337, 40118, 1, 29990], [, , 69654081, 40118, 1, 12990], [, , 69654135, 40118, 1, 12990], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ]]')
		select('LayoutCombo', 'Deptartment')
		select('JTreeTable', 'cell:Tree,4(null)')
		click('Delete2')
		select('JTreeTable', 'cell:department,4(80)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 80, Department: 80], [, , 410, Department: 410], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ]]')
		select_menu('Utilities>>Compare with Disk')
		select('Table', 'cell:keycode,5(67654448)')
##		assert_p('Table', 'Content', '[[, , , , , , ], [, Inserted, 39, 70, Department: 70, , ], [, , , , , , ], [, Inserted, 40, 64614285, 40118, 1, 22990], [, , , , , , ], [, Inserted, 41, 67654448, 40118, 1, 23000], [, , , , , , ], [, Inserted, 42, 67654448, 40118, -1, -23000], [, , , , , , ], [, Inserted, 43, 67654448, 40118, 1, 19010], [, , , , , , ], [, Inserted, 44, 68614241, 40118, 1, 12990], [, , , , , , ], [, Inserted, 45, 68614787, 40118, 1, 27990], [, , , , , , ], [, Inserted, 46, 68634061, 40118, 1, 27990], [, , , , , , ], [, Inserted, 47, 69644337, 40118, 1, 29990], [, , , , , , ], [, Inserted, 48, 69654081, 40118, 1, 12990], [, , , , , , ], [, Inserted, 49, 69654135, 40118, 1, 12990], [, , , , , , ], [, Inserted, 50, 8, 166940, 10, ]]')
		assert_p('Table', 'Content', '[[, Deleted, 39, 70, Department: 70, , ], [, , , , , , ], [, Deleted, 40, 64614285, 40118, 1, 22990], [, , , , , , ], [, Deleted, 41, 67654448, 40118, 1, 23000], [, , , , , , ], [, Deleted, 42, 67654448, 40118, -1, -23000], [, , , , , , ], [, Deleted, 43, 67654448, 40118, 1, 19010], [, , , , , , ], [, Deleted, 44, 68614241, 40118, 1, 12990], [, , , , , , ], [, Deleted, 45, 68614787, 40118, 1, 27990], [, , , , , , ], [, Deleted, 46, 68634061, 40118, 1, 27990], [, , , , , , ], [, Deleted, 47, 69644337, 40118, 1, 29990], [, , , , , , ], [, Deleted, 48, 69654081, 40118, 1, 12990], [, , , , , , ], [, Deleted, 49, 69654135, 40118, 1, 12990], [, , , , , , ], [, Deleted, 50, 8, 166940, 10, ], [, , , , , , ]]')

		select('Table', 'cell:keycode,5(67654448)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select_menu('Window>>protoStoreSales3a.bin>>Tree View')
		click('Save1')
		select_menu('Utilities>>Compare with Disk')
		assert_p('TextPane', 'Text', 'Files are Identical !!!')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select_menu('Window>>protoStoreSales3a.bin>>Tree View')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,4')
		select_menu('Edit Record')
		select('Table', 'cell:Data,0(80)')
		assert_p('Table', 'Content', '[[department, 1, , 80, 80], [name, 2, , Department: 80, Department: 80]]')
		click('Delete2')
		select_menu('Window>>protoStoreSales3a.bin>>Tree View')
		select('JTreeTable', 'cell:department,4(410)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 410, Department: 410], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ]]')
		select_menu('Utilities>>Compare with Disk')
		select('Table', 'cell:saleDate,3(40118)')
##		assert_p('Table', 'Content', '[[, , , , , , ], [, Inserted, 39, 80, Department: 80, , ], [, , , , , , ], [, Inserted, 40, 68664957, 40118, 1, 13990], [, , , , , , ], [, Inserted, 41, 69634699, 40118, 1, 20990], [, , , , , , ], [, Inserted, 42, 69634712, 40118, 1, 20990], [, , , , , , ], [, Inserted, 43, 3, 55970, 3, ]]')
		assert_p('Table', 'Content', '[[, Deleted, 39, 80, Department: 80, , ], [, , , , , , ], [, Deleted, 40, 68664957, 40118, 1, 13990], [, , , , , , ], [, Deleted, 41, 69634699, 40118, 1, 20990], [, , , , , , ], [, Deleted, 42, 69634712, 40118, 1, 20990], [, , , , , , ], [, Deleted, 43, 3, 55970, 3, ], [, , , , , , ]]')

		select('Table', 'cell:saleDate,3(40118)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		click('Save')
		select_menu('Window>>protoStoreSales3a.bin>>Tree View')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		click('Open')
		click('Edit1')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,1')
		select_menu('Expand Tree')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,2')
		select_menu('Expand Tree')
		select('LayoutCombo', 'Deptartment')
		select('JTreeTable', 'cell:department,5(620)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 410, Department: 410], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ]]')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
	close()
